package ee.ttu.rakarh.model.data.dao;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.apache.log4j.Logger;
import org.hibernate.classic.Session;

import ee.ttu.rakarh.model.data.entities.PriceList;
import ee.ttu.rakarh.util.HibernateUtil;

public class PriceListDAOImpl implements PriceListDAO {
	private static final Logger LOG = Logger.getLogger(PriceListDAOImpl.class);
	@Override
	public Collection<PriceList> getAllPriceLists() {
		List<PriceList> priceList = new ArrayList<PriceList>();
		Session session = null;
		try {
			session = HibernateUtil.getSessionFactory().getCurrentSession();
			session.beginTransaction();
			priceList = session.createCriteria(PriceList.class).list();
		}
		catch (Exception e) {
			LOG.error(e);
		}finally{			
			//session.close();
		}
		return priceList;
	}

	@Override
	public void addPriceLists(PriceList priceList) {
		// TODO Auto-generated method stub

	}

	@Override
	public void updatePriceList(PriceList priceList) {
		// TODO Auto-generated method stub

	}

}
